<?php
defined('IN_TS') or die('Access Denied.');
switch($ts){
	case "options":
		$arrOption = array(
			'site_title' => trim($_POST['site_title']),
			'site_subtitle' => trim($_POST['site_subtitle']),
			'site_key' => trim($_POST['site_key']),
			'site_desc' => trim($_POST['site_desc']),
			'site_url' => trim($_POST['site_url']),
			'site_email' => trim($_POST['site_email']),
			'site_icp' => trim($_POST['site_icp']),
			'isface'	=> $_POST['isface'],
		);
	
		foreach ($arrOption as $key => $val){
			$DB->query("UPDATE ".dbprefix."app_system_options SET optionvalue='$val' where optionname='$key'");
		}
		
		$arrOption['site_counter'] = trim($_POST['site_counter']);
		
		AppCacheWrite($arrOption,'system','options.php');
		
		//qiMsg("系统选项更新成功，并重置了缓存文件^_^");
		
		header("Location: index.php?app=system&ac=options");
		break;
}